package com.Web;


import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import util.DateUtil;

import com.Dao.ProjectDao;
import com.entity.Employee;
import com.entity.Project;


public class saveedit extends HttpServlet {

	
	private static final long serialVersionUID = 1L;
	
	
	protected void service(HttpServletRequest requset, HttpServletResponse response)
			throws ServletException, IOException {
			HttpSession session = requset.getSession();
			 String id = requset.getParameter("id");
			
			 String Gname  = requset.getParameter("goalname");
			String   area = requset.getParameter("textarea");
			
			  
			ProjectDao dao = new ProjectDao();
			Project p = new Project();
			p.setId(Integer.parseInt(id));
			p.setName(Gname);
			p.setDesc(area);
			dao.update(p);
			session.setAttribute("p", p);
		
			requset.getRequestDispatcher("/WEB-INF/views/login.jsp").forward(requset, response);
	}
}
